# Maintainer: Aleksandr Palamar <void995@gmail.com>

_realname=gtk-engines
pkgbase=mingw-w64-${_realname}
pkgname="${MINGW_PACKAGE_PREFIX}-${_realname}"
pkgver=2.21.0
pkgrel=5
pkgdesc="Theme engines for GTK+ 2 (mingw-w64)"
arch=('any')
mingw_arch=('mingw32' 'mingw64' 'ucrt64' 'clang64' 'clangarm64' 'clang32')
license=('GPL' 'LGPL')
depends=("${MINGW_PACKAGE_PREFIX}-gtk2>=2.22.0")
makedepends=(
  "${MINGW_PACKAGE_PREFIX}-pkgconf"
  "${MINGW_PACKAGE_PREFIX}-autotools"
  "${MINGW_PACKAGE_PREFIX}-cc"
  "intltool"
)
url="https://live.gnome.org/GnomeArt"
options=('staticlibs' 'strip')
source=(https://sources.archlinux.org/other/gtk-engines/${_realname}-${pkgver}.tar.gz)
conflicts=("${MINGW_PACKAGE_PREFIX}-lighthouse-gtk2" "${MINGW_PACKAGE_PREFIX}-clearlooks-gtk2")
replaces=("${MINGW_PACKAGE_PREFIX}-lighthouse-gtk2")
sha256sums=('6c38c297c3b95d667c5159c1f379384806fedb53a828d44ac73ff54570ed185b')

prepare() {
  cd ${_realname}-${pkgver}
  autoreconf -fiv
}

build() {
  mkdir -p "${srcdir}/build-${MINGW_CHOST}"
  cd "${srcdir}/build-${MINGW_CHOST}"

  ../${_realname}-${pkgver}/configure \
    --prefix=${MINGW_PREFIX} \
    --build=${MINGW_CHOST} \
    --host=${MINGW_CHOST} \
    --enable-animation
  make
}

package() {
  cd "${srcdir}/build-${MINGW_CHOST}"
  make DESTDIR="${pkgdir}" install
}
